package com.yzh.wanandroid.component.activity

import android.content.Intent
import android.os.Handler
import android.os.Looper
import com.yzh.wanandroid.R
import com.yzh.wanandroid.base.BaseActivity
import com.yzh.wanandroid.databinding.ActivitySplashBinding

class SplashActivity: BaseActivity<ActivitySplashBinding>(),Runnable {
    override fun getLayoutId() = R.layout.activity_splash

    private val mHandler: Handler by lazy { Handler(Looper.getMainLooper()) }

    override fun initView() {

    }

    override fun initData() {
        mHandler.postDelayed(this,3000)
    }

    override fun run() {
        startActivity(Intent(this,MainActivity::class.java))
        finish()
    }

    override fun onDestroy() {
        super.onDestroy()
        mHandler.removeCallbacks(this)
    }
}